#include <stdio.h>

namespace sg
{

	#define SEX_MALE 1
	#define SEX_FEMALE 2

	class Person 
	{
	public :
		int public_variable;
	protected :
		int protected_variable;
	private :
		int private_variable;
	};

	class PublicInheritancePerson : public Person 
	{
	public :
		void access()
		{
			printf("[Public] Person.public_variable => Public \n");
			printf("[Public] Person.protected_variable => Protected\n");
			
			// WARNING : I can't access Person's private field
			//printf("Person.private_variable %d",Person::private_variable);
		}
	};

	class ProtectedInheritancePerson : protected Person 
	{
	public :
		void access()
		{
			printf("[Protected] Person.public_variable => protected\n");
			printf("[Protected] Person.protected_variable => protected\n");
			
			// WARNING : I can't access Person's private field
			//printf("Person.private_variable %d",Person::private_variable);
		}
	};

	class PrivateInheritancePerson : private Person 
	{
	public :
		void access()
		{
			printf("[Private] Person.public_variable => private \n");
			printf("[Private] Person.protected_variable => private \n");
			
			// WARNING : I can't access Person's private field
			//printf("Person.private_variable %d",Person::private_variable);
		}
	};
}

int main()
{
	sg::PublicInheritancePerson p1;
	p1.access();
	p1.public_variable = 0;
//	p1.protected_variable = 0;
//	p1.private_variable = 0;

	sg::ProtectedInheritancePerson p2;
	p2.access();
//	p2.public_variable = 0;
//	p2.protected_variable = 0;
//	p2.private_variable = 0;
	
	sg::PrivateInheritancePerson p3;
	p3.access();
//	p3.public_variable = 0;
//	p3.protected_variable = 0;
//	p3.private_variable = 0;
	
	return 0;
}







